<?php session_start();?>
<!DOCTYPE HTML>
<html>
<head>
	<link rel="shortcut icon" href="res/icons/favicon.ico">
	<title>红色石头</title>
	<meta name="description" content="wzwahl36 王小为的技术博客  Xewee Wang's HomePage..." />
	<meta name="keywords" content="wzwahl36, 王小为, Xewee Wang" />
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>

<body>
  <div id="main">
  <?php 
  	require_once ("./inc.header.php");
  ?>
    <div id="site_content">
      <?php
      	require_once ("./inc.right.php");
      ?>    
      <div id="content">
      	<?php 
      		require_once ("./config.inc.php");
			require_once ("./include/mysql.inc.php");
			require_once ("./include/article.inc.php");
			require_once ("./util/stringUtil.inc.php");
			
			$articleDao = new Article();
			$rows = $articleDao->getLatestN(INDEX_ARTICLE_SIZE);
      	?>
      	<?php 
      		foreach ($rows as $article) {
      	?>
      	<div class="block">
      	<h1>
      		<a href="blog.php?id=<?php echo $article[id] ?>"><?php echo $article[title] ?></a>
      	</h1>
		<p align="right"><a><?php echo $article[adminId] ?></a> at  <?php echo $article[time] ?>  &nbsp;&nbsp;&nbsp;&nbsp;</p> 
		<p><?php echo StringUtil::chinasuber(strip_tags(htmlspecialchars_decode($article[content])), INDEX_ARTICLE_CONTENT_LENGTH);?></p>
		<p><a href="blog.php?id=<?php echo $article[id] ?>">&gt;&gt;More</a></p>
		</div>
		<?php }?>
      </div>
    </div>
    <?php
    	require_once ("./inc.footer.php");
    ?>
  </div>
</body>
</html>
<?php 
// 	require_once('./util/Cache.inc.php');
//    $cachedir = './Cache/'; //设定缓存目录
//    $cache = new Cache($cachedir,180); //省略参数即采用缺省设置, $cache = new Cache($cachedir);
//    if ($_GET['cacheact'] != 'rewrite') //此处为一技巧,通过xx.Php?cacheact=rewrite更新缓存,以此类推,还可以设定一些其它操作
//        $cache->load(); //装载缓存,缓存有效则不执行以下页面代码
//    //页面代码开始
//    //页面代码结束
//    $cache->write(); //首次运行或缓存过期,生成缓存
?>